package com.dayu.web.controller.recovery;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.dayu.common.annotation.Log;
import com.dayu.common.core.controller.BaseController;
import com.dayu.common.core.domain.AjaxResult;
import com.dayu.common.enums.BusinessType;
import com.dayu.recovery.domain.TransferGoods;
import com.dayu.recovery.service.ITransferGoodsService;
import com.dayu.common.utils.poi.ExcelUtil;
import com.dayu.common.core.page.TableDataInfo;

/**
 * 移交商品详情Controller
 * 
 * @author HK
 * @date 2023-12-17
 */
@RestController
@RequestMapping("/recovery/transferGoods")
public class TransferGoodsController extends BaseController
{
    @Autowired
    private ITransferGoodsService transferGoodsService;

    /**
     * 查询移交商品详情列表
     */
    @GetMapping("/list")
    public TableDataInfo list(TransferGoods transferGoods)
    {
        startPage();
        List<TransferGoods> list = transferGoodsService.selectTransferGoodsList(transferGoods);
        return getDataTable(list);
    }

    /**
     * 删除移交商品详情
     */
    @Log(title = "移交商品详情", businessType = BusinessType.DELETE)
	@DeleteMapping("/{id}")
    public AjaxResult remove(@PathVariable Long id)
    {
        return toAjax(transferGoodsService.deleteTransferGoodsById(id));
    }
}
